﻿using SD.Infrastructure.RepositoryBase;
using SlamDunk.MES.Domain.Entities.StockContext;
using SlamDunk.MES.ReportView.Models;
using SlamDunk.ValueObjects.Enums;
using System;
using System.Collections.Generic;

namespace SlamDunk.MES.Domain.IRepositories.Interfaces.StockContext
{
    /// <summary>
    /// 库存结转记录仓储接口
    /// </summary>
    public interface IStockSettlementRepository : IAggRootRepository<StockSettlement>
    {
        #region # 分页获取库存结转记录列表 —— ICollection<StockSettlement> FindByPage(Guid? materialId...
        /// <summary>
        /// 分页获取库存结转记录列表
        /// </summary>
        /// <param name="materialId">物料定义Id</param>
        /// <param name="materialLotId">物料批次Id</param>
        /// <param name="storageLocationType">储存位置类型</param>
        /// <param name="storageLocationId">储存位置Id</param>
        /// <param name="startSettledDate">结转日期开始</param>
        /// <param name="endSettledDate">结转日期结束</param>
        /// <param name="facilityIds">工厂模型Id集</param>
        /// <param name="pageIndex">页码</param>
        /// <param name="pageSize">页容量</param>
        /// <param name="rowCount">总记录数</param>
        /// <param name="pageCount">总页数</param>
        /// <returns>库存结转记录列表</returns>
        ICollection<StockSettlement> FindByPage(Guid? materialId, Guid? materialLotId, StorageLocationType? storageLocationType, string storageLocationId, DateTime? startSettledDate, DateTime? endSettledDate, IList<Guid> facilityIds, int pageIndex, int pageSize, out int rowCount, out int pageCount);
        #endregion

        #region # 分页获取物料库存列表 —— ICollection<MaterialStockInfo> GetMaterialStocksByPage(string keywords...
        /// <summary>
        /// 分页获取物料库存列表
        /// </summary>
        /// <param name="keywords">关键字</param>
        /// <param name="materialId">物料定义Id</param>
        /// <param name="materialLotId">物料批次Id</param>
        /// <param name="supplierId">供应商Id</param>
        /// <param name="storageLocationType">储存位置类型</param>
        /// <param name="storageLocationId">储存位置Id</param>
        /// <param name="facilityIds">工厂模型Id集</param>
        /// <param name="pageIndex">页码</param>
        /// <param name="pageSize">页容量</param>
        /// <param name="rowCount">总记录数</param>
        /// <param name="pageCount">总页数</param>
        /// <returns>物料库存列表</returns>
        ICollection<MaterialStockInfo> GetMaterialStocksByPage(string keywords, Guid? materialId, Guid? materialLotId, Guid? supplierId, StorageLocationType? storageLocationType, string storageLocationId, IList<Guid> facilityIds, int pageIndex, int pageSize, out int rowCount, out int pageCount);
        #endregion

        #region # 是否存在库存结转记录 —— bool Exists(Guid materialId, Guid? materialLotId...
        /// <summary>
        /// 是否存在库存结转记录
        /// </summary>
        /// <param name="materialId">物料定义Id</param>
        /// <param name="materialLotId">物料批次Id</param>
        /// <param name="storageLocationType">储存位置类型</param>
        /// <param name="storageLocationId">储存位置Id</param>
        /// <returns>是否存在</returns>
        bool Exists(Guid materialId, Guid? materialLotId, StorageLocationType storageLocationType, string storageLocationId);
        #endregion
    }
}
